package com.sc.controller.property;


import com.sc.result.Result;
import com.sc.service.RepDetailService;
import com.sc.vo.RepDetailVO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/property/rep-detail")
@RequiredArgsConstructor
public class RepDetailController {
    private final RepDetailService repDetailService;

    @GetMapping("/query-by-id/{id}")
    @ApiOperation("根据分类id查询详细项目")
    public Result<List<RepDetailVO>> queryById(@PathVariable Integer id) {
        log.info("根据分类id查询详细项目：{}",id);
        List<RepDetailVO> list = repDetailService.listByDetailId(id);
        return Result.success(list);

    }
}
